Motion detection method based on grey relational analysis

ABSTRACT

A motion detection method determines bit-rate changes of input pixels of a video frame by a grey relational analysis technique to establish a multi-quality background model, detects moving objects by two-stage block-based and pixel-based detection procedures to generate a binary motion mask, detects luminance changes of the video frame by entropy calculation to timely update the background model, provides a setting interface for a user to set a detection sensitivity, and examines false detections of the binary motion mask. Therefore, it can correctly interpret moving objects in VBR video streams, implement more accurate and complete motion detection, eliminate the influence of luminance changes, increase the detection accuracy, and decrease false detections.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to an image processing method and, moreparticularly, to a motion detection method for extracting informationregarding moving objects from video streams.

2. Description of the Related Art

Motion detection is a key technique used in automatic video surveillancesystems to extract information regarding moving objects from videostreams. Motion detection methods can be divided into three majorcategories: temporal difference, optical flow, and backgroundsubtraction methods. Temporal difference method is easy to implement,and calculated amount is little; however, it very often generates holesinside moving objects and inevitably extracts incomplete shapes ofmoving objects. Optical flow method can extract complete shapes ofmoving objects and can detect moving objects when the camera is moving;however, it is not suitable for real-time applications due to largecalculated amount and sensitive to noise. Background subtraction methodis easy to implement and can extract reasonable information regardingmoving objects with moderate calculated amount by using backgroundmodels under a relatively static background; however, it is extremelysensitive to luminance changes. Therefore, background subtractionmethods have been popularly used in motion detection applications, andvarious types of background subtraction methods such as Gaussianmixtures model (GMM), sigma difference estimation (SDE), multiple SDE(MSDE), multiple temporal difference (MTD), and simple statisticaldifference (SSD) methods have been developed.

With recent advances in video communication technology, wirelesscommunication has become more viable for motion detection applicationsas a way to enhance measurement capabilities in a wide range ofdetection of moving objects. Unfortunately, wireless communication isespecially prone to network congestion and server crashes due to thebandwidth constraints of real-world networks. In response, a video ratecontrol technique has been introduced in video streams such as H.264/AVCvideo format which supports variable-bit-rate (VBR) encoding to adaptreal-world network conditions. The aforementioned conventionalbackground subtraction methods can detect moving objects in videostreams which have fixed bit rates. In such an ideal, stableenvironment, moving objects are easily distinguished by the backgroundmodels of these methods. However, because real-world networks rarelyoffer an ideal, stable environment, the aforementioned conventionalbackground subtraction methods possibly misinterpret moving objects whenthe bit rate suddenly changes, and effective detection of moving objectsin VBR video streams is a very difficult problem for these methods.

For example, referring to FIG. 6, there is illustrated a diagram showingluminance values of pixels at the same position of several video framesin a VBR video stream. In the beginning at the 150^(th) video frame, thevideo stream has a high bit rate of 200 kbps and has a strong, fluctuant(or high-quality) background signal B1 accordingly. The conventionalbackground subtraction methods generate background models according tothe strong, fluctuant background signal B1. When video communication ishindered by network congestion, the video rate control techniqueallocates the remaining network bandwidth, and subsequently, at the240^(th) video frame, the video stream becomes to have a low bit rate of5 kbps and have a smooth (or low-quality) background signal B2 with astrong, fluctuant motion signal P1 due to a passing moving object. Ifthe motion signal P1 is present while the background model is not yetupdated (that is, still generated according to the strong, fluctuantbackground signal B1), the conventional background subtraction methodspossibly misinterpret the motion signal P1 as a background signal. Aftera period of time, the background model is updated according to thesmooth background signal B2. However, when video communication is nothindered at the 280^(th) video frame, the video stream is restored tohave a high bit rate of 200 kbps and have a strong, fluctuant (orhigh-quality) background signal B3. If the background signal B3 ispresent while the background model is not yet updated (that is, stillgenerated according to the smooth background signal B2), theconventional background subtraction methods possibly misinterpret thebackground signal B3 as a motion signal. Therefore, the conventionalbackground subtraction methods possibly misinterpret when the bit rateof video streams changes from high to low, or from low to high.

SUMMARY OF THE INVENTION

The present invention is adapted to providing a motion detection method,which can correctly interpret moving objects in VBR video streams toimplement more accurate and complete motion detection, and can eliminatethe influence of luminance changes.

According to an aspect of the present invention, there is provided amotion detection method based on grey relational analysis. The motiondetection method includes the following steps: S1) receiving a videoframe including a plurality of input pixels; S2) establishing amulti-quality background model; S3) detecting moving objects; S4)detecting luminance changes of the video frame; S5) examining falsedetections of the binary motion mask.

Moreover, the step of S2 includes: S21) calculating a Euclidean distancebetween a pixel value of each input pixel and a pixel value of each of aplurality of corresponding candidate background pixels; S22) accordingto the Euclidean distances, calculating a grey relational coefficientbetween the pixel value of each input pixel and the pixel value of eachof the corresponding candidate background pixels; S23) for each inputpixel, determining whether the minimum value of the grey relationalcoefficients is smaller than or equal to a first threshold value; ifyes, determining that a bit rate of the input pixel has been changed,and the input pixel is regarded as a new candidate background pixelaccordingly; if no, determining that the bit rate of the input pixel isnot changed.

Moreover, the step of S3 includes: S31) dividing the video frame into aplurality of blocks, and for each block, summing up the maximum valuesof the grey relational coefficients between the pixel value of eachinput pixel and the pixel values of the corresponding candidatebackground pixels within the block to generate a grey relationalcoefficient sum regarding the block; S32) determining whether the greyrelational coefficient sum is larger than or equal to a second thresholdvalue; if yes, determining that the block is a background block; if no,determining that the block is a motion block; S33) for each input pixelwithin each motion block, determining whether the maximum value of thegrey relational coefficients between the pixel value of each input pixeland the pixel values of the corresponding candidate background pixels islarger than or equal to a third threshold value; if yes, determiningthat the input pixel is a background pixel; if no, determining that theinput pixel is a motion pixel; S34) generating a binary motion mask.

Moreover, the step of S4 includes: S41) calculating an entropy of thegrey relational coefficient sum of each block, and summing up theentropies of the grey relational coefficient sums of the blocks togenerate an entropy sum regarding the video frame; S42) determiningwhether a difference between the entropy sum of the video frame and anentropy sum of a previous video frame is larger than or equal to afourth threshold value; if yes, determining that the video frame hasluminance changes, and updating a candidate background pixelcorresponding to each input pixel according to the video frame; if no,determining that the video frame has no luminance changes.

Moreover, the step of S5 includes: S51) providing a setting interfacefor a user to set a detection sensitivity; S52) dividing a total numberof the motion pixels and the background pixels of the binary motion maskby an area of the binary motion mask to generate an examination value;S53) determining whether the examination value is larger than a productof a fifth threshold value and the detection sensitivity, wherein aprediction number of true positive pixels divided by the area of thebinary motion mask is the fifth threshold value; if yes, determiningthat there are false detections; if no, determining that there are nofalse detections.

The motion detection method determines bit-rate changes of the inputpixels by the grey relational analysis technique to establish themulti-quality background model, and therefore can correctly interpretmoving objects in VBR video streams. The motion detection method furtherdetects moving objects by two-stage detection procedures (i.e.block-based and pixel-based detection procedures) to generate the binarymotion mask, and therefore can implement more accurate and completemotion detection. The motion detection method further detects luminancechanges of the video frame by entropy calculation to timely update thebackground model, and therefore can eliminate the influence of luminancechanges. The motion detection method further provides the settinginterface for the user to set the detection sensitivity with highervalues meaning higher detection accuracy, and examines false detectionsof the binary motion mask; therefore, it can increase the detectionaccuracy and decrease false detections.

BRIEF DESCRIPTION OF THE DRAWINGS

The present invention will be described in further detail below underreference to the accompanying drawings, in which:

FIG. 1 is a flow chart of a motion detection method based on greyrelational analysis according to a preferred embodiment of theinvention;

FIG. 2 is a flow chart of a method for establishing a multi-qualitybackground model according to a preferred embodiment of the invention;

FIG. 3 is a flow chart of a method for detecting moving objectsaccording to a preferred embodiment of the invention;

FIG. 4 is a flow chart of a method for detecting luminance changes of avideo frame according to a preferred embodiment of the invention;

FIG. 5 is a flow chart of a method for examining false detections of abinary motion mask according to a preferred embodiment of the invention;and

FIG. 6 is a diagram showing luminance values of pixels at the sameposition of several video frames in a VBR video stream.

DETAILED DESCRIPTION OF THE INVENTION

Referring to FIG. 1, there is illustrated a flow chart of a motiondetection method based on grey relational analysis according to apreferred embodiment of the invention. In a step S1, the motiondetection method receives a video stream including a plurality of videoframes. Each video frame includes a plurality of input pixels. Forconvenience of distinction and explanation, the t^(th) video frame isnotated as I_(t), and an input pixel at a position (x,y) of the t^(th)video frame I_(t) is notated as p_(t)(x,y). In the embodiment, themotion detection method is implemented in a YC_(b)C_(r) color space, andeach input pixel p_(t)(x,y) has a corresponding color or pixel valuerepresented by three variables: a luminance value (Y), a blue-differencechroma value (C_(b)), and a red-difference chroma value (C_(r)). Inaddition, each of the luminance value (Y), the blue-difference chromavalue (C_(b)), and the red-difference chroma value (C_(r)) can berepresented by 8 bits with values of 0 to 255.

In a step S2, the motion detection method determines bit-rate changes ofthe input pixels by the grey relational analysis technique to establisha multi-quality background model. In the embodiment, referring to FIG.2, there is illustrated a flow chart of a method for establishing amulti-quality background model according to a preferred embodiment ofthe invention. In a step S21, the method calculates a Euclidean distanceΔ between a pixel value of each input pixel p_(t)(x,y) and a pixel valueof each of a plurality of corresponding candidate background pixelsB(x,y)₁ to B(x,y)_(M). The Euclidean distance Δ can be expressed foreach input pixel p_(t)(x,y) as follows:Δ(k)=∥p _(t)(x,y)−B(x,y)_(k)∥where k is an integer ranging from 1 to M, and M is the number ofcorresponding candidate background pixels. Because the motion detectionmethod is implemented in the YC_(b)C_(r) color space, each candidatebackground pixel B(x,y)_(k) has a corresponding color or pixel valuerepresented by three variables: a luminance value (Y), a blue-differencechroma value (C_(b)), and a red-difference chroma value (C_(r)). Thelonger Euclidean distance Δ(k) indicates the larger difference betweenthe input pixel p_(t)(x,y) and the candidate background pixelB(x,y)_(k), whereas the shorter Euclidean distance Δ(k) indicates thesmaller difference between the input pixel p_(t)(x,y) and the candidatebackground pixel B(x,y)_(k).

In a step S22, the method calculates, according to the Euclideandistances Δ(1) to Δ(M), a grey relational coefficient γ between thepixel value of each input pixel p_(t)(x,y) and the pixel value of eachof the corresponding candidate background pixels B(x,y)₁ to B(x,y)_(M).The grey relational coefficient γ can be expressed for each input pixelp_(t)(x,y) as follows:

${\gamma( {{p_{t}( {x,y} )},{B( {x,y} )}_{k}} )} = \frac{\Delta_{\min} + {\xi\;\Delta_{\max}}}{{\Delta(k)} + {\xi\;\Delta_{\max}}}$where k is an integer ranging from 1 to M, Δ_(min) represents theminimum difference, and Δ_(max) represents the maximum difference.Because each of the luminance value (Y), the blue-difference chromavalue (C_(b)), and the red-difference chroma value (C_(r)) isrepresented by 8 bits with values of 0 to 255, Δ_(min) and Δ_(max) canbe set to 0 and 255, respectively. In addition, ξ represents adistinguishing coefficient ranging from 0 to 1, and in the embodiment, ξis set to 0.2. The smaller grey relational coefficient γ(p_(t)(x,y),B(x,y)_(k)) indicates the lower correlation (i.e. the larger difference)between the input pixel p_(t)(x,y) and the candidate background pixelB(x,y)_(k), whereas the larger grey relational coefficient γ(p_(t)(x,y),B(x,y)_(k)) indicates the higher correlation (i.e. the smallerdifference) between the input pixel p_(t)(x,y) and the candidatebackground pixel B(x,y)_(k).

In a step S23, the method determines, for each input pixel p_(t)(x,y),whether the minimum value of the grey relational coefficientsγ(p_(t)(x,y), B(x,y)₁) to γ(p_(t)(x,y), B(x,y)_(M)) is smaller than orequal to a first threshold value ε. If yes, it indicates that there issubstantially no correlation between the input pixel p_(t)(x,y) and thecandidate background pixels B(x,y)₁ to B(x,y)_(M), and the method goesto a step S231 accordingly. In the step S231, the method determines thata bit rate of the input pixel p_(t)(x,y) has been changed, and abit-rate-change indication V_(k) of the input pixel p_(t)(x,y) islabelled as ‘1’. Moreover, the input pixel p_(t)(x,y) can be regarded asa new candidate background pixel. If no, it indicates that there is veryhigher correlation between the input pixel p_(t)(x,y) and some candidatebackground pixel, and the method goes to a step S232 accordingly. In thestep S232, the method determines that the bit rate of the input pixelp_(t)(x,y) is not changed, and the bit-rate-change indication V_(k) ofthe input pixel p_(t)(x,y) is labelled as ‘0’. By doing so, themulti-quality background model can be flexibly established in the VBRvideo stream. The bit-rate-change indication V_(k) can be expressed foreach input pixel p_(t)(x,y) as follows:

$V_{k} = \{ \begin{matrix}{1,{{{if}\mspace{14mu}{\min( {\gamma( {{p_{t}( {x,y} )},{B( {x,y} )}_{k}} )} )}} \leq ɛ}} \\{0,{otherwise}}\end{matrix} $where k is an integer ranging from 1 to M, and the first threshold valueε can be empirically set to 0.6.

Referring again to FIG. 2, in a step S3, the motion detection methoddetects moving objects by two-stage detection procedures (i.e.block-based and pixel-based detection procedures) to generate a binarymotion mask. In the embodiment, referring to FIG. 3, there isillustrated a flow chart of a method for detecting moving objectsaccording to a preferred embodiment of the invention. The block-baseddetection procedure includes steps S31, S32, S321, and S322. In the stepS31, the method divides the video frame I_(t) into a plurality of blocksM(i,j). In the embodiment, according to MacroBlock types supported byH.264 video encoding, the video frame I_(t) is divided into 16×16 blocksM(1,1) to M(1,16), M(2,1) to M(2,16), . . . , and M(16,1) to M(16,16),which are notated as M(1,1) to M(16,16) hereinafter; in other words, iand j of M(i,j) are integer ranging from 1 to 16. For each block M(i,j),the method sums up the maximum values of the grey relationalcoefficients γ(p_(t)(x,y), B(x,y)₁) to γ(p_(t)(x,y), B(x,y)_(M)) betweenthe pixel value of each input pixel p_(t)(x,y) and the pixel values ofthe corresponding candidate background pixels B(x,y)₁ to B(x,y)_(M)within the block M(i,j) to generate a grey relational coefficient sumS(i,j) regarding the block M(i,j). The grey relational coefficient sumS(i,j) can be expressed for each block M(i,j) as follows:

${S( {i,j} )} = {\sum\limits_{p_{t} \in {M{({i,j})}}}{\max( {\gamma( {{p_{t}( {x,y} )},{B( {x,y} )}_{k}} )} )}}$where k is an integer ranging from 1 to M.

In the step S32, the method determines whether the grey relationalcoefficient sum S(i,j) is larger than or equal to a second thresholdvalue α. If yes, it indicates that the block M(i,j) is not a motionblock, and the method goes to the step S321 accordingly. In the stepS321, the method determines that the block M(i,j) is a background block,and a motion block indication R(i,j) of the block M(i,j) is labelled as‘0’. If no, it indicates that many input pixels p_(t)(x,y) within theblock M(i,j) are parts of moving objects, and the method goes to thestep S322. In the step S322, the method determines that the block M(i,j)is a motion block, and the motion block indication R(i,j) of the blockM(i,j) is labelled as ‘1’. The motion block indication R(i,j) can beexpressed for each block M(i,j) as follows:

${R( {i,j} )} = \{ \begin{matrix}{0,{{{if}\mspace{14mu}{S( {i,j} )}} \geq \alpha}} \\{1,{otherwise}}\end{matrix} $where the second threshold value α can be experimentally set to 245.

The pixel-based detection procedure includes steps S33, S331, S332, andS34. In the step S33, for each input pixel p_(t)(x,y) within each motionblock, the method determines whether the maximum value of the greyrelational coefficients γ(p_(t)(x,y), B(x,y)₁) to γ(p_(t)(x,y),B(x,y)_(M)) between the pixel value of each input pixel p_(t)(x,y) andthe pixel values of the corresponding candidate background pixelsB(x,y)₁ to B(x,y)_(M) is larger than or equal to a third threshold valueβ. If yes, it indicates that there is very higher correlation betweenthe input pixel p_(t)(x,y) and some candidate background pixel, and themethod goes to the step S331 accordingly. In the step S331, the methoddetermines that the input pixel p_(t)(x,y) is a background pixel. If no,it indicates that there is substantially no correlation between theinput pixel p_(t)(x,y) and the candidate background pixels B(x,y)₁ toB(x,y)_(M), and the method goes to the step S332 accordingly. In thestep S332, the method determines that the input pixel p_(t)(x,y) is amotion pixel. Next, in the step S34, the method generates a binarymotion mask BM which can be expressed as follows:

${{BM}( {x,y} )} = \{ \begin{matrix}{0,{{{if}\mspace{14mu}{\max( {\gamma( {{p_{t}( {x,y} )},{B( {x,y} )}_{k}} )} )}} \geq \beta}} \\{1,{otherwise}}\end{matrix} $where k is an integer ranging from 1 to M, and the third threshold valueβ can be empirically set to 0.6.

Referring again to FIG. 2, in a step S4, the motion detection methoddetects luminance changes of the video frame by entropy calculation totimely update the background model. In the embodiment, referring to FIG.4, there is illustrated a flow chart of a method for detecting luminancechanges of a video frame according to a preferred embodiment of theinvention. In a step S41, the method calculates an entropy of the greyrelational coefficient sum S(i,j) of each block M(i,j) via the entropyformula—S(i,j)log(S(i,j)), and sums up the entropies regarding theblocks M(1,1) to M(16,16) to generate an entropy sum E_(t) regarding thevideo frame I_(t). The entropy sum E_(t) can be expressed as follows:

$E_{t} = {- {\sum\limits_{{({i,j})} \in I_{t}}{{S( {i,j} )}{\log( {S( {i,j} )} )}}}}$

In a step S42, the method determines whether a difference between theentropy sum E_(t) of the video frame I_(t) and an entropy sum E_(t-1) ofa previous video frame I_(t-1), i.e. |E_(t)−E_(t-1)|, is larger than orequal to a fourth threshold value μ. If yes, it indicates that the videoframe I_(t) has sudden luminance changes, and the method goes to a stepS421. In the step S421, the method determines that the video frame I_(t)has luminance changes, and a luminance-change indication L_(t) islabelled as ‘1’. If no, the method goes to a step S422 to determine thatthe video frame I_(t) has no luminance changes, and the luminance-changeindication L_(t) is labelled as ‘0’. The luminance-change indicationL_(t) can be expressed as follows:

$L_{t} = \{ \begin{matrix}{1,{{{if}\mspace{14mu}{{E_{t} - E_{t - 1}}}} \geq \mu}} \\{0,{otherwise}}\end{matrix} $where the fourth threshold value μ can be empirically set to 0.05.Furthermore, in the step S421, because the method determines that thevideo frame I_(t) has luminance changes, it can update a candidatebackground pixel B(x,y)_(s) corresponding to each input pixel p_(t)(x,y)according to the video frame I_(t) as follows:B(x,y)′_(s) =B(x,y)_(s)+ρ(p _(t)(x,y)−B(x,y)_(s))where B(x,y)_(s) represents a candidate background pixel at a position(x,y) which will be updated, B(x,y)′_(s) represents a updated candidatebackground pixel at the position (x,y), and ρ represents a defaultparameter. The candidate background pixel B(x,y)_(s) which will beupdated can be chosen from a candidate background pixel corresponding tothe maximum value of the Euclidean distances Δ(1) to Δ(M). The candidatebackground pixel B(x,y)_(s) which will be updated can be expressed asfollows:

${B( {x,y} )}_{s} = {\arg\;{\max\limits_{k = {1\mspace{11mu}{to}\mspace{11mu} M}}{\Delta(k)}}}$

Referring again to FIG. 2, in a step S5, the motion detection methodprovides an adjustable detection sensitivity and examines falsedetections of the binary motion mask BM. In the embodiment, referring toFIG. 5, there is illustrated a flow chart of a method for examiningfalse detections of a binary motion mask according to a preferredembodiment of the invention. In a step S51, the method provides asetting interface for a user to set the detection sensitivity ds. Forexample, the setting interface is a graphical user interface having abar with a slide, and the detection sensitivity ds can be adjusted from0 to 10. The higher detection sensitivity ds indicates the higherdetection accuracy, whereas the lower detection sensitivity ds indicatesthe lower detection accuracy

In a step S52, the method divides a total number n_(dp) of the motionpixels and the background pixels of the binary motion mask BM by an areaof the binary motion mask BM to generate an examination value E_(BM).The examination value E_(BM) can be expressed as follows:

$E_{BM} = \frac{n_{dp}}{\dim\; X\;\dim\; Y}$where n_(dp)=p_(p)+p_(n), p_(p) represents the number of the motionpixels of the binary motion mask BM, p_(n) represents the number of thebackground pixels of the binary motion mask BM, and dimX and dimYrepresent the width and the height of the binary motion mask BM,respectively.

In a step S53, the method determines whether the examination valueE_(BM) is larger than a product of a fifth threshold value δ and thedetection sensitivity ds, wherein a prediction number Ω of true positivepixels divided by the area of the binary motion mask BM is the fifththreshold value δ. The fifth threshold value δ can be expressed asfollow:

$\delta = \frac{\Omega}{\dim\; X\;\dim\; Y}$If yes, E_(BM)>δ×ds, and the method goes to a step S531. In the stepS531, the method determines that there are false detections in thebinary motion mask BM, and a fault alarm indication F is labelled as‘1’. If no, E_(BM)≦δ×ds, and the method goes to a step S532. In the stepS532, the method determines that there are no false detections in thebinary motion mask BM, and the fault alarm indication F is labelled as‘0’. The fault alarm indication F can be expressed as follows:

$F = \{ \begin{matrix}{1,{{{if}\mspace{14mu} E_{BM}} > {\delta \times {ds}}}} \\{0,{otherwise}}\end{matrix} $where the prediction number Ω of true positive pixels can beexperimentally set to 30×30.

It will be apparent to those skilled in the art that variousmodifications and variations can be made to the structure of the presentinvention without departing from the scope or spirit of the presentinvention. In view of the foregoing, it is intended that the presentinvention cover modifications and variations of this invention providedthey fall within the scope of the following claims and theirequivalents.

What is claimed is:
 1. A motion detection method based on greyrelational analysis, comprising: S1) receiving a video frame comprisinga plurality of input pixels; S2) establishing a multi-quality backgroundmodel, comprising: S21) calculating a Euclidean distance between a pixelvalue of each input pixel and a pixel value of each of a plurality ofcorresponding candidate background pixels; S22) according to theEuclidean distances, calculating a grey relational coefficient betweenthe pixel value of each input pixel and the pixel value of each of thecorresponding candidate background pixels; S23) for each input pixel,determining whether the minimum value of the grey relationalcoefficients is smaller than or equal to a first threshold value; ifyes, determining that a bit rate of the input pixel has been changed,and the input pixel is regarded as a new candidate background pixelaccordingly; if no, determining that the bit rate of the input pixel isnot changed; S3) detecting moving objects, comprising: S31) dividing thevideo frame into a plurality of blocks, and for each block, summing upthe maximum values of the grey relational coefficients between the pixelvalue of each input pixel and the pixel values of the correspondingcandidate background pixels within the block to generate a greyrelational coefficient sum regarding the block; S32) determining whetherthe grey relational coefficient sum is larger than or equal to a secondthreshold value; if yes, determining that the block is a backgroundblock; if no, determining that the block is a motion block; S33) foreach input pixel within each motion block, determining whether themaximum value of the grey relational coefficients between the pixelvalue of each input pixel and the pixel values of the correspondingcandidate background pixels is larger than or equal to a third thresholdvalue; if yes, determining that the input pixel is a background pixel;if no, determining that the input pixel is a motion pixel; S34)generating a binary motion mask; S4) detecting luminance changes of thevideo frame, comprising: S41) calculating an entropy of the greyrelational coefficient sum of each block, and summing up the entropiesof the grey relational coefficient sums of the blocks to generate anentropy sum regarding the video frame; S42) determining whether adifference between the entropy sum of the video frame and an entropy sumof a previous video frame is larger than or equal to a fourth thresholdvalue; if yes, determining that the video frame has luminance changes,and updating a candidate background pixel corresponding to each inputpixel according to the video frame; if no, determining that the videoframe has no luminance changes; S5) examining false detections of thebinary motion mask, comprising: S51) providing a setting interface for auser to set a detection sensitivity; S52) dividing a total number of themotion pixels and the background pixels of the binary motion mask by anarea of the binary motion mask to generate an examination value; S53)determining whether the examination value is larger than a product of afifth threshold value and the detection sensitivity, wherein aprediction number of true positive pixels divided by the area of thebinary motion mask is the fifth threshold value; if yes, determiningthat there are false detections; if no, determining that there are nofalse detections.
 2. The motion detection method of claim 1, wherein thecandidate background pixel corresponding to the input pixel which willbe updated is chosen from a candidate background pixel corresponding tothe maximum value of the Euclidean distances between the pixel value ofthe input pixel and the pixel value of the corresponding candidatebackground pixels.
 3. The motion detection method of claim 1, whereineach of the pixel values of the input pixels and the candidatebackground pixels comprises a luminance value, a blue-difference chromavalue, and a red-difference chroma value.
 4. The motion detection methodof claim 3, wherein each of the luminance value, the blue-differencechroma value, and the red-difference chroma value is represented by 8bits.
 5. The motion detection method of claim 4, wherein the firstthreshold value is set to 0.6.
 6. The motion detection method of claim4, wherein the second threshold value is set to
 245. 7. The motiondetection method of claim 4, wherein the third threshold value is set to0.6.
 8. The motion detection method of claim 4, wherein the fourththreshold value is set to 0.05.
 9. The motion detection method of claim1, wherein the prediction number of true positive pixels is set to30×30, and the detection sensitivity is set to 0 to 10 by the user. 10.The motion detection method of claim 1, wherein the blocks are 16×16blocks.